<?php include("connection.php"); ?>
<?php 
$config_id=$_REQUEST['config_id'];
echo $config_id;
$query=mysql_query("SELECT * FROM configuration where idConfiguration='$config_id'");
$row=mysql_fetch_array($query);
//print_r($row);

function get_name($type,$code)
{
    switch($type)
    {
        case "1":
        $query1 = mysql_query("SELECT * from `airport_code` WHERE airport_code='$code' order by rank") ;
        $row1=mysql_fetch_array($query1);
        echo $row1['name'].' ('.$row1['airport_code'].')';
        break;
        case "2":
        $query1 = mysql_query("SELECT * from `states` WHERE state_code='$code'") ;
        $row1=mysql_fetch_array($query1);
        echo $row1['state_name'].' ('.$row1['state_code'].')';
        break;
        case "3":
        $query1 = mysql_query("SELECT * from `countries` WHERE country_code='$code'") ;
        $row1=mysql_fetch_array($query1);
        echo $row1['country_name'].' ('.$row1['country_code'].')';
        break;
        case "4":
        $query1 = mysql_query("SELECT * from `region` WHERE region_code='$code'") ;
        $row1=mysql_fetch_array($query1);
        echo $row1['region_name'].' ('.$row1['region_code'].')';
        break;
        case "5":
		$query1 = mysql_query("SELECT * FROM `airport_code` order by rank");
		$row1=mysql_fetch_array($query1);
		echo $row1['name'].' ('.$row1['airport_code'].')';
        break;
		

    }
    
}




?>


<style type="text/css">
<!--
body, td, th {
    font-family: segoe UI, tahoma, trebuchet MS, verdana;
    font-size: 12px;
    color: #000;
}
body {
    margin-left: 0px;
    margin-top: 0px;
    margin-right: 0px;
    margin-bottom: 0px;
}
a:link {
    color: #03C;
    text-decoration: none;
}
a:visited {
    text-decoration: none;
    color: #03C;
}
a:hover {
    text-decoration: none;
    color: #03C;
}
a:active {
    text-decoration: none;
    color: #03C;
}
.checkbox {
}
select{    font-family: segoe UI, tahoma, trebuchet MS, verdana;
    font-size: 12px;
    color: #000;}
input{    font-family: segoe UI, tahoma, trebuchet MS, verdana;
    font-size: 12px;
    color: #000; }
-->
</style>

<div align="center">
<form id="test_markup" >
<input type="text" style="display:none;" value="<?php echo $config_id; ?>" id="config_id" name="config_id"/>
<input type="text" style="display:none;" value="<?php echo $row['dep_code']; ?>" id="dep_code" name="dep_code"/>
<input type="text" style="display:none;" value="<?php echo $row['arr_code']; ?>" id="ret_code" name="ret_code"/>
<table width="550" height="87" border="0" cellpadding="4" cellspacing="1">
  <tr>
    <td align="left"  valign="top" bgcolor="#F3F3F3"><strong>&raquo; Test Markup</strong></td>
</tr>
  <tr>
    <td width="364" align="left" bgcolor="#f8f8f8"><strong>&raquo; Departure </strong></td>
</tr>
  <tr>
    <td align="left" bgcolor="#f8f8f8">
      
      
      
      Select Type-&gt;
      <input type="radio" name="dep_type" id="dep_arp" value="1" align="absmiddle" class="required" <?php if($row['dep_type']=='1'){ ?> checked="checked" <?php } ?>/>Aiport
      <input type="radio" name="dep_type" id="dep_sta" value="2" align="absmiddle" class="required" <?php if($row['dep_type']=='2'){ ?> checked="checked" <?php } ?>/>State
      <input type="radio" name="dep_type" id="dep_con" value="3" align="absmiddle" class="required" <?php if($row['dep_type']=='3'){ ?> checked="checked" <?php } ?>/>Country
      <input type="radio" name="dep_type" id="dep_reg" value="4" align="absmiddle" class="required" <?php if($row['dep_type']=='4'){ ?> checked="checked" <?php } ?>/>Region
      
    </td>
    </tr>
  <tr>
    <td align="left" bgcolor="#f8f8f8" id="dep_t">&nbsp;<?php get_name($row['dep_type'],$row['dep_code']); ?></td>
    </tr>
  <tr>
    <td align="left" bgcolor="#f8f8f8"><strong>&raquo; Arrival</strong></td>
  </tr>
  <tr>
    <td align="left" bgcolor="#f8f8f8">Select Type-&gt;
      <input type="radio" name="ret_type" id="ret_arp" value="1" align="absmiddle" class="required" <?php if($row['arr_type']=='1'){ ?> checked="checked" <?php } ?>/>
      Aiport
      <input type="radio" name="ret_type" id="ret_sta" value="2" align="absmiddle" class="required" <?php if($row['arr_type']=='2'){ ?> checked="checked" <?php } ?>/>
      State
      <input type="radio" name="ret_type" id="ret_con" value="3" align="absmiddle" class="required" <?php if($row['arr_type']=='3'){ ?> checked="checked" <?php } ?>/>
      Country
      <input type="radio" name="ret_type" id="ret_reg" value="4" align="absmiddle" class="required" <?php if($row['arr_type']=='4'){ ?> checked="checked" <?php } ?>/>
      Region</td>
  </tr>
  <tr>
    <td align="left" bgcolor="#f8f8f8" id="ret_t">&nbsp;<?php get_name($row['arr_type'],$row['arr_code']); ?></td>
  </tr>
  </table>
<table width="550" border="0" cellpadding="4" cellspacing="0">
  <tr>
    <td width="116" align="left" bgcolor="#F8F8F8"><strong>Fare type</strong></td>
    <td width="418" align="left" bgcolor="#F8F8F8"><select name="fare_type" id="fare_type" style="width:145px;">
      <option value="ALL" selected="selected">ALL</option>
      <option value="SR">SR</option>
      <option value="SRP">SRP</option>
      <option value="PUB">PUB</option>
      </select></td>
  </tr>
  <tr>
    <td align="left" bgcolor="#F8F8F8"><strong>Airline Code</strong></td>
    <td align="left" bgcolor="#F8F8F8" id="air_li" >
    <select name="ailie" id="ailie" class="required">
    <option value="ALL" class="selected" selected="selected">ALL</option>
    </select>
</td>
  </tr>
  <tr>
    <td align="left" bgcolor="#F8F8F8"><strong>Trip Type</strong></td>
    <td align="left" bgcolor="#F8F8F8"><select name="trip_type" id="trip_type" style="width:145px;">
	<option value="ALL" selected="selected">BOTH</option>
	 <option value="RT">ROUND TRIP</option>
     <option value="OW">ONE WAY</option>
    </select></td>
  </tr>
  <tr>
    <td align="left" bgcolor="#F8F8F8"><strong>PTC</strong></td>
    <td align="left" bgcolor="#F8F8F8"><select name="ptc" id="ptc"  style="width:145px;">
	  <option value="ALL" selected="selected">ALL PTC</option>	
      <option value="ADT">ADT</option>
      <option value="CNN">CNN</option>
      <option value="INF">INF</option>
      <option value="JCB">JCB</option>
      <option value="JNF">JNF</option>
      <option value="JNN">JNN</option>
    </select></td>
  </tr>
  <tr>
    <td align="left" bgcolor="#F8F8F8"><strong>Cabin Class</strong></td>
    <td align="left" bgcolor="#F8F8F8"><select name="cabin_class" id="cabin_class" style="width:145px;">
      <option value="E">Economic Class </option>
      <option value="F">First Class </option>
      <option value="B">Business Class </option>
    </select></td>
  </tr>
  <tr>
    <td align="left" bgcolor="#F8F8F8"><strong>SID</strong></td>
    <td align="left" bgcolor="#F8F8F8"><select name="sid" id="sid" style="width:145px;">
	  <option value="ALL" selected="selected">ALL</option>	
      <option value="XSY">XSY</option>
      <option value="33J">33J</option>
    </select></td>
  </tr>
  <tr>
    <td align="left" bgcolor="#F8F8F8"><strong>Range</strong></td>
    <td align="left" bgcolor="#F8F8F8">
    
     <select name="price_range"  class="required">    
    <option value="1">100-250</option>
    <option value="2">251-500</option>
    <option value="3">501-750</option>
    <option value="4">751-1000</option>
    <option value="5">&gt;1000</option>
    <option value="ALL" selected="selected">Any Value</option>
    </select>
    
    
 <!--   <select name="range" id="range" style="width:145px;">
      <option value="1">1</option>
      <option value="2">2</option>
      <option value="3">3</option>
      <option value="4">4</option>
    </select> -->
    
    
    </td>
  </tr>
  <tr>
    <td align="left" bgcolor="#F8F8F8"><strong>Time Search</strong></td>
    <td align="left" bgcolor="#F8F8F8"><select name="time_search" id="time_search" style="width:145px;">
      <option value="A" selected="selected">Any Time</option>
      <option value="D">DAY</option>
      <option value="N">NIGHT</option>
    </select></td>
  </tr>
  <tr>
    <td align="left" bgcolor="#F8F8F8"><strong>Flight Type</strong></td>
    <td align="left" bgcolor="#F8F8F8"><select name="flight_type" id="flight_type" style="width:145px;">
      <option value="3" selected="selected">ANY STOP</option>
      <option value="0">NON STOP </option>
      <option value="1">ONE STOP </option>
      <option value="2">TWO OR MORE STOP </option>
    </select></td>
  </tr>
  <tr>
    <td colspan="2" align="center" bgcolor="#F8F8F8"><input type="submit" value=
        "Test Markup" /></td>
  </tr>
</table>
<p>&nbsp;</p>
</form>
</div>




